<script setup lang="ts">
import type { ChannelItem } from '@/types';

defineProps<{
    channels: ChannelItem[]
    activeId: number
}>()

const emits = defineEmits<{
    "updataActiveId": [activeId: number]
}>()

</script>


<template>
    <div class="channel-nav">
        <nav class="list">
            <a v-for="(item, i) in channels" class="item" :class="{ active: item.id === activeId }" href="javascript:;"
                :key="item.id" @click="emits('updataActiveId', item.id)">
                {{ item.name }}
            </a>
        </nav>
    </div>
</template>